<?php
/* Class Mail By TheDeamon (infoxp) */

	class Mail
	{
		private $to,$subject,$message,$header;
		
		const NO_MAIL_SEND = 0;
		const MAIL_SEND = 1;
		const MAIL_INVALID_PARAMETERS_FORMAT = 2;
		
		public function __construct($to=null,$subject=null,$message=null,$header=null)
		{
			$this->to = $to;
			$this->subject = $subject;
			$this->message = $message;
			$this->header = $header;
		}
		
		public function setTo($to)
		{
			$this->to= $to;
			return $this;	
		}
		
		public function To()
		{
			return $this->to;	
		}
		
		public function setSubject($subject)
		{
			$this->subject = $subject;
			return $this;	
		}
		
		public function Subject()
		{
			return $this->subject;	
		}
		
		public function setMessage($message)
		{
			$this->message = $message;
			return $this;	
		}
		
		public function Message()
		{
			return $this->message;	
		}
		
		public function setHeader($header)
		{
			$this->header = $header;
			return $this;	
		}
		
		public function Header()
		{
			return $this->header;	
		}
		
		public function send()
		{
			if($this->To() != null && $this->Subject() != null && $this->Message() != null)
			{
				if(!@mail($this->To(),$this->Subject(),$this->Message(),$this->Header()))
					return self::NO_DELIVERY_MAIL;	
				else
					return self::MAIL_SEND;
			}else
				return self::MAIL_INVALID_PARAMETERS_FORMAT;
		}
	}

?>